cmake_minimum_required(VERSION 3.11)

project(hashcode
    LANGUAGES CXX
    VERSION 0.0
)

# 设置软件版本的宏
add_definitions(-DVERSION="${CMAKE_PROJECT_VERSION}")
message("软件版本：" ${CMAKE_PROJECT_VERSION})

# 库
# add_subdirectory(cryptopp-cmake/)
list(APPEND CMAKE_MODULE_PATH ${PROJECT_SOURCE_DIR}/dependent/)
find_package(Cryptopp REQUIRED)


# 设置C++标准
set(CMAKE_CXX_STANDARD 17) # C++17
set(CMAKE_CXX_STANDARD_REQUIRED True)

# 编译器设置
if(CMAKE_CXX_COMPILER_IMPORT_STD MATCHES "GUN")
    add_compile_options(
        "-Wall"      # 显示所有报错
        "-Wextra"
        "-Wpedantic" # 严格遵守标准
        "-std=17"
        "-O2"
    )
endif()

# 输出路径
set(EXECUTABLE_OUTPUT_PATH ${CMAKE_SOURCE_DIR}/release/bin)

# 编译可执行文件
add_executable(hashcode "main.cpp")

# 链接库
target_link_libraries(hashcode PRIVATE Cryptopp::cryptopp)